import 'dart:convert';

import 'package:dio/dio.dart';

class SearchService {
  static Future<List<String>> fetchWordGroup(String word) async {
    Dio dio = Dio();
    var res = await dio.get('https://www.baidu.com/sugrec?prod=pc&wd=$word');
    var s = jsonDecode(res.data);
    var list = <String>[];
    for (var x in s['g']) {
      list.add(x['q']);
    }
    return list;
  }
}
